{extend name="$index_style_layout" /}

<!--SEO相关-->
{block name="head_title"}{$fid?($info['seo_title']?:$info['name']):$m_info['title']}{/block}
{block name="head_keword"}{$fid?($info['seo_keywords']?:$info['name']):$m_info['title']}{/block}
{block name="head_description"}{$info.seo_description}{/block}

{block name="body_AllScorllSlide"}
<!--通栏横幅图片__STATIC__/css/qb_ui.css中控制图片宽度百分百高度行内样式设置，如不设置不小于100px---->
{qb:tag name="web_banner_pic01" type="image"}
<!--
<div class="qb_ui_AllscrollBanner" style="height:300px;">
	<a href="#1"><img src="__STATIC__/images/s0.jpg"></a>
</div>
-->
<div class="qb_ui_AllscrollBanner" style="height:300px;">
	<a href="{$url}"><img src="{$picurl}"></a>
</div>
{/qb:tag}
{/block}
{block name="body_content"}
<style type="text/css">
.qb_ui_ListArticleTimeTitleCnt h3 a.choose{
	color:red;
}
</style>
<link rel="stylesheet" href="__STATIC__/index/default/pclist.css">
<div class="ArticlMainContainer">
	<div class="LeftsCnt">
		<link rel="stylesheet" href="__STATIC__/index/default/left.css">
		<div class="LeftBoxInfo">
			<ul class="sorts">
				<li class="{$type==0?'ck':''}"><a href="?type=0&mid={$mid}">播放记录</a></li>
				<li class="{$type==1?'ck':''}"><a href="?type=1&mid={$mid}">我的收藏</a></li>
			</ul>
		</div>
	</div>
	<div class="RightCnt">
		
				<!-- 视频模型 -->
				<center>{:fun('Player@play',$listdb[0]['url'],800,600)}</center><br>

		{volist name="$listdb" id="rs"}
			<ul class="qb_ui_ListArticleTimeTitleCnt listdiv_{$key}">
				<ol>
					<dl><i class="fa fa-headphones" style="font-size:45px;"></i></dl>
				</ol>
				<li>
					<h3><a {if $i==1}class="choose"{/if} href="{:urls('content/show',['id'=>$rs['aid']])}?sid={$rs.sid}">{$rs.title|get_word=100}</a></h3>
					<p>主题：《{$rs['info']['title']}》 发布者：{:get_user_name($rs['info']['uid'])} <i onclick="del_fav({$rs.aid},{$rs.sid},{$key})" class="glyphicon glyphicon-remove-circle">移除</i></p>
				</li>
			</ul>
		{/volist}
	</div>
</div>


<script type='text/javascript'>
var mv_index = 0;
var url_array = [ 
	{volist name="$listdb" id="rs"} 
		{ 
			url:'{$rs.url}',
			play_time:{$rs.playtime},
			info_id:"{$rs.aid}",
			info_sid:"{$rs.sid}",
			info_page:"{:urls('content/show',['id'=>$rs['aid']])}?sid={$rs.sid}",
		}, 
	{/volist} 
	];
function change_play(index){
	mv_index = index;
	layer.msg("请稍候,视频加载中...");
	player1.newVideo({autoplay:true,video:url_array[index].url});

	$(".qb_ui_ListArticleTimeTitleCnt h3 a").removeClass('choose');
	$(".qb_ui_ListArticleTimeTitleCnt").eq(index).find("h3 a").addClass('choose');
}

//监听播放器状态
function loadedHandler1(){
	player1.addListener('loadedmetadata', function(){
		player1.videoSeek(url_array[0].play_time);
		player1.videoPlay();	//自动播放
	});

	check_power(mv_index);

	player1.addListener('ended', function(){	//当前播放完毕,播放下一个
		mv_index++;
		if(typeof(url_array[mv_index])!='undefined'){
			change_play(mv_index);
			check_power(mv_index);
		}else{
			layer.alert("全部播放完毕了!");
		}		
	});
}


function del_fav(id,sid,i){	//从库中删除
	var url="{:urls('wxapp.fav/delete')}?type={$type}&id="+id+"&sid="+sid;
	$.get(url,function(res){
		if(res.code==0){
			layer.msg('成功移除');
			$(".listdiv_"+i).remove();
		}else{
			layer.alert(res.msg);
		}
	})
}
</script>
<!--用到的JS-->
{include file="fav/inc"}

{/block}